Skip to content

feat: add profile and contacts fetching from pubky#824

Open
ben-kaufman wants to merge 36 commits intomasterfrom
feat/pubky-profile
Open

feat: add profile and contacts fetching from pubky#824
ben-kaufman wants to merge 36 commits intomasterfrom
feat/pubky-profile

Conversation

@ben-kaufman
Copy link
Contributor

@ben-kaufman ben-kaufman commented Mar 5, 2026

Integrates Pubky decentralized identity into Bitkit, adding profile authentication, a contacts screen.

What's included

Pubky profile

  • Authentication flow via Pubky Ring deep links (pubkyauth://) with relay-based session exchange, session persistence in Keychain, and automatic session restoration on launch
  • Profile page displaying name, bio, links, and a QR code with profile picture overlaid
  • Home screen integration showing the authenticated user's name and avatar in the header
  • PubkyService — service layer wrapping paykit (session management) and bitkit-core (auth relay, file fetching, profile/contacts)
  • PubkyRepo — manages auth state, session lifecycle, profile, and contacts data with all I/O offloaded to background threads
  • PubkyImage component for loading pubky:// URIs with two-tier (memory + disk) caching
  • PubkyStore DataStore caches profile name and image URI for instant display before full profile loads
  • Suggestion card auto-dismiss when user is already authenticated

Pubky contacts

  • Contacts intro screen with navigation to profile auth if not yet signed in
  • Contacts list with alphabetical grouping and search
  • Contact detail screen showing name, bio, links, and copy/share actions
  • Contacts fetched concurrently on login and session restore; failed fetches fall back to a placeholder

@claude

This comment has been minimized.

claude[bot]

This comment was marked as outdated.

@jvsena42
Copy link
Member

jvsena42 commented Mar 9, 2026

Starting review

@ovitrif ovitrif added this to the 2.2.0 milestone Mar 9, 2026
ovitrif

This comment was marked as resolved.

@piotr-iohk
Copy link
Collaborator

Few issues/comments found during testing:

  1. Hardcoded production domains — no staging support

The capabilities in PubkyService are hardcoded to pubky.app / paykit.app:

/pub/paykit.app/v0/:rw,/pub/pubky.app/profile.json:rw,/pub/pubky.app/follows/:rw

For dev/tnet/E2E builds we should be using staging.pubky.app / staging.paykit.app instead — Pubky Ring already distinguishes between staging and production based on homeserver. This will be needed for E2E test automation.

  1. Unrecoverable "Unable to load profile" state

After hitting a profile load failure (possibly related to the staging mismatch above), the app gets stuck on an "Unable to load profile" screen with no way to disconnect/sign out. Resetting wallet and wiping app data from system settings do not clear it - only a full reinstall works. The session seems to persist somewhere that survives both of those operations (Keychain?).
(both probably apply to iOS as well, have not checked yet)

Screen_Recording_20260313_185242_Bitkit.Regtest.mp4
  1. App crash on tapping "share" icon on pubky profile - I think already mentioned by Ovi.
  2. After authorizing in Pubky Ring, the user stays in Ring instead of being redirected back to Bitkit. Would be great if Ring navigated back automatically after approval. Likely a Pubky Ring-side change.

@piotr-iohk
Copy link
Collaborator

Also My profile in Contacts does not show profile details as opposed to iOS (checked on latest revision 78d16f7), also already mentioned by Ovi:

Screen.Recording.2026-03-16.at.14.03.24.mov

ben-kaufman and others added 7 commits March 16, 2026 22:29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ovitrif

This comment was marked as resolved.

@jvsena42
Copy link
Member

What is the best way to testing this? A Pubky Ring on staging?

@ovitrif

This comment was marked as outdated.

@piotr-iohk
Copy link
Collaborator

What is the best way to testing this? A Pubky Ring on staging?

Test in prod, yolo!

From what I see staging doesn't work still? Or maybe it is because of HTTP-auth required on staging 🤔 (IMO we should solve this and allow testing on staging):

Screen.Recording.2026-03-16.at.18.22.17.mov

@piotr-iohk
Copy link
Collaborator

What is the best way to testing this? A Pubky Ring on staging?

Test in prod, yolo!

From what I see staging doesn't work still? Or maybe it is because of HTTP-auth required on staging 🤔 (IMO we should solve this and allow testing on staging):

Screen.Recording.2026-03-16.at.18.22.17.mov

Actually started to work after I http-auth'ed to staging.pubky.app in browser... 🤷 👍

@ben-kaufman ben-kaufman requested a review from ovitrif March 17, 2026 07:43
Copy link
Collaborator

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version works for me 🙌🏻

@ovitrif
Copy link
Collaborator

ovitrif commented Mar 17, 2026

What is the best way to testing this? A Pubky Ring on staging?

IDK… but the way I test it is Pubky Ring on prod + bitkit app on Regtest 🤷🏻

Is it supposed not to work? xD Maybe… but it does 🙃

@piotr-iohk
Copy link
Collaborator

What is the best way to testing this? A Pubky Ring on staging?

IDK… but the way I test it is Pubky Ring on prod + bitkit app on Regtest 🤷🏻

Is it supposed not to work? xD Maybe… but it does 🙃

It seems pubky ring supports multiple pubkys on different homeservers in the same app. I could test with staging and prod pubky on the same ring installation.

@ovitrif
Copy link
Collaborator

ovitrif commented Mar 17, 2026

What is the best way to testing this? A Pubky Ring on staging?

IDK… but the way I test it is Pubky Ring on prod + bitkit app on Regtest 🤷🏻
Is it supposed not to work? xD Maybe… but it does 🙃

It seems pubky ring supports multiple pubkys on different homeservers in the same app. I could test with staging and prod pubky on the same ring installation.

I use pubky ring with the pubky I use for pubky.app, so that should be auth-scoped to prod :).

of course, prod ring supports testnet pubkys also 👍🏻

what I was trying to say is that you (ie anyone willing to test) doesn't need anything staging-like for ring, just use prod ring with your prod pubky that you're supposed to have in it.

But then I was wondering if this is ok 🤷🏻
I mean, as long as someone tests with staging and it still works, then it should be ok, at least from the "we tested it" pov.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants